package com.tech.zhidengxian.controller;

import com.tech.zhidengxian.model.dto.AttentionDTO;
import com.tech.zhidengxian.model.dto.CategoryDTO;
import com.tech.zhidengxian.model.dto.result.ReturnResult;
import com.tech.zhidengxian.model.dto.result.ReturnResultUtils;
import com.tech.zhidengxian.service.api.AttentionService;
import com.tech.zhidengxian.service.api.CategoryService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Ljh
 * @date 2023/5/14 12:48
 * @description
 **/
@RestController
@RequestMapping("/attention")
public class AttentionController {
    @Resource
    private AttentionService attentionService;
    @RequestMapping("/updateAttention")
    public ReturnResult<List<AttentionDTO>> updateAttention(@RequestBody AttentionDTO attentionDTO){
        return ReturnResultUtils.returnSuccess(attentionService.updateAttention(attentionDTO));
    }

    @RequestMapping("/queryAttention")
    public ReturnResult<AttentionDTO> queryAttention(@RequestBody AttentionDTO attentionDTO){
        return ReturnResultUtils.returnSuccess(attentionService.queryAttention(attentionDTO));
    }

    @RequestMapping("/queryListByUid")
    public ReturnResult<List<AttentionDTO>> queryListByUid(@RequestBody Long uid){
        return ReturnResultUtils.returnSuccess(attentionService.queryListByUid(uid));
    }


}
